package com.vegetable.modules.controller.stock;

import com.alibaba.fastjson.JSON;
import com.vegetable.common.utils.PageUtils;
import com.vegetable.common.utils.R;
import com.vegetable.modules.service.stock.IAgentStockService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * <p>
 * 代办库存表 前端控制器
 * </p>
 *
 * @author wangruijie
 * @since 2024-04-10
 */
@Slf4j
@RestController
@RequestMapping("/agentStock")
@AllArgsConstructor
@Api(value = "代办库存", tags = "代办库存")
public class AgentStockController {

    private IAgentStockService stockService;

    /**
     * 代办库存列表
     */
    @GetMapping("/list")
    @ApiOperation(value = "条件查询代办库存列表", notes = "条件查询代办库存列表")
    public R list(@RequestParam Map<String, Object> params){
        log.info("条件查询代办库存列表{}", JSON.toJSONString(params));
        PageUtils page = stockService.queryPage(params);
        return R.data( page);
    }
}
